package com.wangijun.yuan.core.domain;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;

import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDateTime;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 标签表
 */
@Schema(description = "标签表")
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "tag_info")
public class TagInfo implements Serializable {
    /**
     * 主键
     */
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    @Schema(description = "主键")
    private Long id;

    /**
     * 标签名称
     */
    @TableField(value = "`name`")
    @Schema(description = "标签名称")
    private String name;

    /**
     * 创建时间
     */
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    @Schema(description = "创建时间")
    private LocalDateTime createTime;

    /**
     * 修改时间
     */
    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
    @Schema(description = "修改时间")
    private LocalDateTime updateTime;

    /**
     * 创建人
     */
    @TableField(value = "create_by", fill = FieldFill.INSERT)
    @Schema(description = "创建人")
    private Long createBy;

    /**
     * 修改人
     */
    @TableField(value = "update_by", fill = FieldFill.INSERT_UPDATE)
    @Schema(description = "修改人")
    private Long updateBy;

    /**
     * 标签热度
     */
    @TableField(value = "read_num")
    @Schema(description = "标签热度")
    private Integer readNum;

    /**
     * 排序
     */
    @TableField(value = "sort")
    @Schema(description = "排序")
    private Integer sort;

    /**
     * 此标签下最新文章Id
     */
    @TableField(value = "new_art_id")
    @Schema(description = "此标签下最新文章Id")
    private Long newArtId;

    /**
     * 最新标签文章标题
     */
    @TableField(value = "new_art_title")
    @Schema(description = "最新标签文章标题")
    private String newArtTitle;

    /**
     * 关注数
     */
    @TableField(value = "follow_num")
    @Schema(description = "关注数")
    private Integer followNum;
    @Serial
    private static final long serialVersionUID = 1L;
}